package com.woniuxy.main.service.imp;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.main.mapper.CommentMapper;
import com.woniuxy.main.pojo.Comment;
import com.woniuxy.main.service.CommentService;

@Service
public class CommentServiceImp implements CommentService {
	
	@Autowired
	private CommentMapper commentMapper;

	@Override	//生成评价信息
	public int insertComment(Comment comment) {
		//评价时间
		String commentDate = new SimpleDateFormat("y-M-d HH:mm:ss").format(new Date());
		comment.setCommentDate(commentDate);
		return commentMapper.insertComment(comment);
	}

	
	@Override	//获取评价信息
	public Comment getComment(Comment comment) {
		return commentMapper.getComment(comment);
	}
}
